| Visual Basic (Declaration) | |
|---|---|
Public Function LoginAsync( _ Optional ByVal credential As ILoginCredential, _ Optional ByVal options As LoginOptions, _ Optional ByVal userCallback As Action(Of LoginOperation), _ Optional ByVal userState As Object _ ) As LoginOperation | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As Authenticator Dim credential As ILoginCredential Dim options As LoginOptions Dim userCallback As Action(Of LoginOperation) Dim userState As Object Dim value As LoginOperation value = instance.LoginAsync(credential, options, userCallback, userState) | |
| C# | |
|---|---|
public LoginOperation LoginAsync( ILoginCredential credential, LoginOptions options, Action<LoginOperation> userCallback, object userState ) | |
| C++/CLI | |
|---|---|
public: LoginOperation^ LoginAsync( ILoginCredential^ credential, LoginOptions^ options, Action<LoginOperation^>^ userCallback, Object^ userState ) | |
Parameters
- credential
- options
- userCallback
- userState
You can pass a null (Nothing in Visual Basic) in place of an IdeaBlade.EntityModel.ILoginCredential object. Null credentials can indicate either that the user is logging in as a guest or anonymous user, or when using the AspAuthenticatingLoginManager that the current authenticated user should be loaded. When using ASP.NET the current authenticated user is one authenticated via Windows authentication, or is the user already logged in because of either a persistent cookie or a login performed elsewhere in the ASP.NET application. If you are not using the AspAuthenticationLoginManager then your implementation of IEntityLoginManager should handle a null credential if your client application can provide one.
The AllowAnonymousLogin flag in the IdeaBlade configuration determines whether "anonymous" users can login to your application. Anonymous users are ones who have not supplied credentials and who also cannot be authenticated by other means, such as ASP.NET authentication.
Provide a userCallback if you want to be notified when the operation completes. Use the userState to uniquely identify this call.
The AuthenticationContext returned from a successful login in the IdeaBlade.EntityModel.LoginOperation or IdeaBlade.EntityModel.LoginEventArgs can be used in two ways: 1) you can set the DefaultAuthenticationContext so that any EntityManager in your application will share the credentials and not require a separate login, or 2) you can set the IdeaBlade.EntityModel.EntityManager.AuthenticationContext on one or more EntityManager instances. Note that without performing one of these actions the returned AuthenticationContext will not be used by DevForce.
Credentials are passed in clear text. Use a secure channel (such as SSL) or provide your own encryption if secure communications are necessary.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family